public class Rectangle {
	private Point p1, p2;
	
	Rectangle(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;
	}
	
	public Double getArea() {
		
		double length  = p2.x - p1.x;
		double width = p2.y - p1.y;		
		
		return Math.abs(length * width);
	}
	
	public Double getDiagonal() {
		double length  = p2.x - p1.x;
		double width = p2.y - p1.y;	
		
		return Math.sqrt(Math.pow((length), 2) + Math.pow((width), 2));
	}
}
